'''
Created on Jan 29, 2012

@author: nzhao
'''
from math import pi
import numpy as np
import MaterialData as ma

Angstrom = 1.0 * 10**-10;
Mu0      = 4 * pi * 10**-7;
Hbar     = 1.054571596 * 10**-34;


# gyromagnetic ratios in rad / s / T
GAMMA_E   = -1.760859794 * 10**11  # free electron 
Gamma_C13 =  6.726149871 * 10**7;  # Carbon-13
Gamma_N14 =  1.9338 * 10**7        # Nitrogen-14
Gamma_N15 = -2.7116 * 10**7        # Nitrogen-15
Gamma_H   =  2.67522212 * 10**8    #Proton

GammaUnit = Gamma_C13
GammaUnit_B = GammaUnit * 10**(-4) / 1000.0 # k rad / s 
SpinSpinInteraction = Mu0 / 4.0 / np.pi * GammaUnit**2 / Angstrom**3 * Hbar / 1000.0

SpinDictionary={'E': {'SpinValue':                  0.5,
                      'GyromagneticRatio':          GAMMA_E,
                      'RelativeGyromagneticRatio':  GAMMA_E / GammaUnit
                      },
                'NV': {'SpinValue':                 1.0,
                       'GyromagneticRatio':         GAMMA_E,
                       'RelativeGyromagneticRatio': GAMMA_E / GammaUnit,
                       'ZeroFieldSplitting':        ma.NV_ZFS
                       },
                'C13': {'SpinValue':                0.5,
                      'GyromagneticRatio':          Gamma_C13,
                      'RelativeGyromagneticRatio':  Gamma_C13 / GammaUnit
                      },
                'N14': {'SpinValue':                1.0,
                      'GyromagneticRatio':          Gamma_N14,
                      'RelativeGyromagneticRatio':  Gamma_N14 / GammaUnit,
                      'ZeroFieldSplitting':         ma.NV_N14_ZFS
                      },
                'N15': {'SpinValue':                0.5,
                      'GyromagneticRatio':          Gamma_N15,
                      'RelativeGyromagneticRatio':  Gamma_N15 / GammaUnit
                      },
                'H1':  {'SpinValue':                0.5,
                      'GyromagneticRatio':          Gamma_H,
                      'RelativeGyromagneticRatio':  Gamma_H / GammaUnit
                      }                      
                }


